package com.cty.util.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试控制器
 *
 * @author : cty
 * @since 2023/11/19
 */

@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {

    @GetMapping("/debug")
    public String debug() {
        log.debug("/test/ok 请求开始...");
        String rs = "debug: OK OK OK";
        log.debug("/test/ok 请求结束...rs:{}", rs);
        return rs;
    }

    @GetMapping("/info")
    public String info() {
        log.info("/test/ok 请求开始...");
        String rs = "info: OK OK OK";
        log.info("/test/ok 请求结束...rs:{}", rs);
        return rs;
    }

    @GetMapping("/warn")
    public String warn() {
        log.warn("/test/ok 请求开始...");
        String rs = "warn: OK OK OK";
        log.warn("/test/ok 请求结束...rs:{}", rs);
        return rs;
    }

    @GetMapping("/error")
    public String error() {
        log.error("/test/ok 请求开始...");
        String rs = "error: OK OK OK";
        log.error("/test/ok 请求结束...rs:{}", rs);
        return rs;
    }
}
